import request from '../request';
let api = {
  blogTree: "/api/home/article/column-tree", //博客栏目
  blogList: "/api/home/article/list", //博客列表
  blogInfo: "/api/home/article/info", //博客详情
  isthumbsUp: "/api/home/article/is-thumbs-up", //是否点赞过文章
  thumbsUp: "/api/home/article/thumbs-up", //点赞文章
  commentList: "/api/home/article/comment-list", //文章评论列表
  comment: "/api/home/article/comment", //文章评论
  delComment: "/api/home/article/delComment", //删除文章评论
  //提交博客
  submitBlog: `/api/home/article/add`
}
export default {
  //用户新增博客
  submitBlog(params) {
    return request.post(api.submitBlog,
      params
    );
  },
  //博客栏目
  blogTree(params = {}) {
    return request.get(api.blogTree, {
      params
    });
  },
  //博客列表
  blogList(params = {}) {
    return request.get(api.blogList, {
      params
    });
  },
  //博客详情
  blogInfo(params = {}) {
    return request.get(api.blogInfo, {
      params
    });
  },
  //是否点赞过文章
  isthumbsUp(params = {}) {
    return request.get(api.isthumbsUp, {
      params
    });
  },
  //点赞文章
  thumbsUp(params = {}) {
    return request.post(api.thumbsUp,
      params
    );
  },
  //文章评论列表
  commentList(params = {}) {
    return request.get(api.commentList, {
      params
    });
  },
  //文章评论
  comment(params = {}) {
    return request.post(api.comment,
      params
    );
  },
  //删除文章评论
  delComment(params = {}) {
    return request.post(api.delComment,
      params
    );
  },
}
